Skip to content

Fix APP-B2Q (3/3): give notification-preferences a distinct path param to avoid reportID collision - #94688

Merged
mountiny merged 3 commits into
mainfrom
claude-fixDynamicRouteQueryCollision
Jul 10, 2026
Merged

Fix APP-B2Q (3/3): give notification-preferences a distinct path param to avoid reportID collision#94688
mountiny merged 3 commits into
mainfrom
claude-fixDynamicRouteQueryCollision

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This is 3 of 3 independent fixes for the JS throws bucketed under Sentry APP-B2Q (#93845). It addresses error #4: [createDynamicRoute] Query param "reportID" exists in both base path and dynamic suffix.

NOTIFICATION_PREFERENCES declared reportID as a query param. When the screen is opened from a member's Profile with .getRoute(report.reportID), the suffix contributes ?reportID=<memberDM> while the base URL already carries a different ?reportID=<reportInChain> inherited from the ancestor report chain. createDynamicRoute merges the two query strings and throws on any key present on both sides — that uncaught error is the crash. (Opening the same screen from report settings used .path with no explicit reportID, so it inherited the same value and never conflicted.)

The fix gives the screen a distinct path-param name (notificationReportID) so it can never collide with an inherited reportID, and it keeps the inherited ?reportID= intact for back navigation. This needs no changes to the core dynamic-route functions (createDynamicRoute, getStateForDynamicRoute), so the original guard against genuinely contradictory query params is preserved for every other route.

  1. NOTIFICATION_PREFERENCES becomes a path param and its getRoute returns notification-preferences/<id> (no queryParams).
  2. The screen's nav param type is renamed reportIDnotificationReportID.
  3. withReportOrNotFound resolves the id from whichever param the screen provides, using type-safe in narrowing (no type assertions), so every other screen keeps reading reportID unchanged.
  4. The report-settings call site passes the target report explicitly through getRoute.
Code references

Fixed Issues

$ #93845
PROPOSAL: #94688 (comment)

Note: this PR only addresses error #4 of APP-B2Q. Error #1 is handled in #94617; error #3 is in #94687; error #2 is a native react-native-reanimated issue tracked separately.

Tests

  1. As an admin, open any workspace chat with any member.
  2. Tap the header to open the Details page.
  3. Tap Members.
  4. Tap any member other than yourself.
  5. Tap Profile.
  6. Tap Notify me about new messages (notification preferences).
  7. Verify that the notification preferences page is opened normally and that the app is not crashing.

Offline tests

Same as Tests steps.

QA Steps

Same as Tests steps.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Fixes APP-B2Q error #4: '[createDynamicRoute] Query param reportID exists in
both base path and dynamic suffix'. mergeQueryStrings threw whenever a key
appeared in both the base path (active route) and the dynamic suffix, even when
both carried the same value. On HybridApp the restored active route can already
hold ?reportID=R1, so re-emitting the same reportID from a dynamic route threw.
Now it only throws when the values actually differ, and collapses identical
duplicates into one param.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I analyzed the failing checks. No code fix is needed — every automated check that runs the code has passed (Jest tests across all 8 shards, Bun tests, typecheck, ESLint, Prettier, knip, unused-styles, React Compiler, spellcheck, Storybook).

The only failing check is PR Author Checklist / checklist, which reports You completed 0 out of 41 checklist items. This isn't a bug in the code — it's the author-attestation checklist in the PR description, which is currently unchecked. The PR body explicitly leaves the Tests / QA Steps / checklist sections for the human co-author to fill out, so I can't resolve this by pushing a commit — checking those boxes would be falsely attesting that a human tested on every platform.

To clear this check, ahmedGaber93 needs to:

  • Fill out the Tests, Offline tests, and QA Steps sections in the PR description.
  • Check the boxes in the PR Author Checklist after verifying each item.

The remaining build (...) and *-perf-tests checks were still running when I looked; they're native builds / performance benchmarks and aren't affected by this 6-line query-string merge change.

@ahmedGaber93

ahmedGaber93 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Steps to reproduce

  1. As a admin open any workspace chat with any member.
  2. Tap the header to open the Details page.
  3. Tap Members.
  4. Tap any member other than yourself.
  5. Tap Profile.
  6. Tap Notify me about new messages (notification preferences).

The app crashes. createDynamicRoute throws because the member's reportID (from the suffix) collides with the different reportID inherited in the URL from the report chain:

[createDynamicRoute] Query param "reportID" exists in both base path and dynamic suffix. This is not allowed.

Video
Screen.Recording.2026-07-09.at.12.21.04.AM.mov

Root cause

Critical finding: the crash depends on which entry screen opens the shared notification-preferences dynamic route.

  • From report settings, it's opened with .pathno explicit reportID — so it simply inherits the reportID already present in the URL. The base path and the suffix therefore reference the same report, and there's no conflict: DynamicReportSettingsPage.tsx#L80.
  • From a member's Profile, it's opened with .getRoute(report.reportID), where report.reportID is the member's 1:1 DM — a different report than the one carried in the ancestor URL: ProfilePage.tsx#L313.

NOTIFICATION_PREFERENCES declares reportID as a query param: ROUTES.ts#L554-L559. So from Profile the suffix contributes ?reportID=<memberDM> while the base URL already carries ?reportID=<reportInChain> (leaked from the report chain).

createDynamicRoute then merges the two query strings and throws on any key that exists in both the base path and the suffix — that uncaught error is the crash: createDynamicRoute.ts#L22-L37.

And even if the merge didn't throw, the result would still be wrong: when the navigation state is built, query params are spread over path/parent params, so the inherited value would silently win over the intended one: getStateForDynamicRoute.ts#L77.


Fix

Give the screen a distinct path-param name (notificationReportID) so it can never collide with an inherited reportID. This needs no changes to the core dynamic-route functions.

1. Turn the route into a path param in src/ROUTES.ts:

 NOTIFICATION_PREFERENCES: {
-    path: 'notification-preferences',
+    path: 'notification-preferences/:notificationReportID',
     entryScreens: [SCREENS.REPORT_SETTINGS.DYNAMIC_ROOT, SCREENS.DYNAMIC_PROFILE],
-    getRoute: (reportID: string) => getUrlWithParams('notification-preferences', {reportID}),
-    queryParams: ['reportID'],
+    getRoute: (notificationReportID: string) => `notification-preferences/${notificationReportID}` as const,
 },

2. Update the param type in src/libs/Navigation/types.ts:

 [SCREENS.REPORT_SETTINGS.DYNAMIC_NOTIFICATION_PREFERENCES]: {
-    reportID: string;
+    notificationReportID: string;
 };

3. Resolve the ID from whichever param the screen provides in src/pages/inbox/report/withReportOrNotFound.tsx, using type-safe in narrowing (no type assertions) so every other screen keeps reading reportID unchanged:

 function WithReportOrNotFound(props: TProps) {
+    const params = props.route.params;
+    const reportID = 'notificationReportID' in params ? params.notificationReportID : params.reportID;
     const [betas] = useOnyx(ONYXKEYS.BETAS);
-    const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${props.route.params.reportID}`);
+    const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
     const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`);
-    const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${props.route.params.reportID}`);
-    const [reportLoadingState] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${props.route.params.reportID}`);
+    const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`);
+    const [reportLoadingState] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${reportID}`);
     ...
-    const isReportIdInRoute = !!props.route.params.reportID?.length;
+    const isReportIdInRoute = !!reportID?.length;
     ...
-    openReport({reportID: props.route.params.reportID, introSelected, betas});
-    }, [shouldFetchReport, isReportLoaded, props.route.params.reportID]);
+    openReport({reportID, introSelected, betas});
+    }, [shouldFetchReport, isReportLoaded, reportID]);

4. Pass the target report through getRoute at the call site in src/pages/settings/Report/DynamicReportSettingsPage.tsx:

-    onPress={() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.NOTIFICATION_PREFERENCES.path))}
+    onPress={() => {
+        if (!reportID) {
+            return;
+        }
+        Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.NOTIFICATION_PREFERENCES.getRoute(reportID)));
+    }}
Full code changes

src/ROUTES.ts

 NOTIFICATION_PREFERENCES: {
-    path: 'notification-preferences',
+    // `reportID` is intentionally carried as a distinct path param (`notificationReportID`) rather than
+    // `reportID`, so it never collides with a `reportID` inherited from the surrounding report chain's
+    // query string. This keeps the inherited `?reportID=` intact for back navigation.
+    path: 'notification-preferences/:notificationReportID',
     entryScreens: [SCREENS.REPORT_SETTINGS.DYNAMIC_ROOT, SCREENS.DYNAMIC_PROFILE],
-    getRoute: (reportID: string) => getUrlWithParams('notification-preferences', {reportID}),
-    queryParams: ['reportID'],
+    getRoute: (notificationReportID: string) => `notification-preferences/${notificationReportID}` as const,
 },

src/libs/Navigation/types.ts

 [SCREENS.REPORT_SETTINGS.DYNAMIC_NOTIFICATION_PREFERENCES]: {
-    reportID: string;
+    notificationReportID: string;
 };

src/pages/inbox/report/withReportOrNotFound.tsx

 function WithReportOrNotFound(props: TProps) {
+    const params = props.route.params;
+    // Most screens carry the report ID under `reportID`. The notification-preferences screen instead
+    // owns its target report as a distinct path param (`notificationReportID`) so it never collides
+    // with a `reportID` inherited from the surrounding report chain in the URL.
+    const reportID = 'notificationReportID' in params ? params.notificationReportID : params.reportID;
     const [betas] = useOnyx(ONYXKEYS.BETAS);
-    const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${props.route.params.reportID}`);
+    const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
     const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`);
-    const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${props.route.params.reportID}`);
-    const [reportLoadingState] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${props.route.params.reportID}`);
+    const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`);
+    const [reportLoadingState] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${reportID}`);
     const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA);
     const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
     const isFocused = useIsFocused();
     const contentShown = React.useRef(false);
-    const isReportIdInRoute = !!props.route.params.reportID?.length;
+    const isReportIdInRoute = !!reportID?.length;
     ...
-                openReport({reportID: props.route.params.reportID, introSelected, betas});
+                openReport({reportID, introSelected, betas});
                 // eslint-disable-next-line react-hooks/exhaustive-deps
-            }, [shouldFetchReport, isReportLoaded, props.route.params.reportID]);
+            }, [shouldFetchReport, isReportLoaded, reportID]);

src/pages/settings/Report/DynamicReportSettingsPage.tsx

-    onPress={() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.NOTIFICATION_PREFERENCES.path))}
+    onPress={() => {
+        if (!reportID) {
+            return;
+        }
+        Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.NOTIFICATION_PREFERENCES.getRoute(reportID)));
+    }}

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Please implement this proposal #94688 (comment) instead of your proposal and update the OP

Replaces the createDynamicRoute mergeQueryStrings change with ahmedGaber93's
proposal: route the notification-preferences target report through a distinct
`notificationReportID` path param so it can never collide with a `reportID`
inherited from the surrounding report chain's query string. No changes to the
core dynamic-route functions.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot MelvinBot changed the title Fix APP-B2Q (3/3): only throw in createDynamicRoute on a genuine query-param value conflict Fix APP-B2Q (3/3): give notification-preferences a distinct path param to avoid reportID collision Jul 8, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Done — implemented your proposal (comment) instead of the mergeQueryStrings change, and updated the OP.

What changed (pushed to claude-fixDynamicRouteQueryCollision):

  • Reverted the createDynamicRoute.ts + test changes back to main, so the core dynamic-route guard is untouched.
  • NOTIFICATION_PREFERENCES is now a path param (notification-preferences/:notificationReportID); getRoute returns the path form and queryParams is dropped.
  • Nav param type renamed reportIDnotificationReportID.
  • withReportOrNotFound resolves the id via type-safe in narrowing ('notificationReportID' in params ? … : params.reportID), so every other screen keeps reading reportID.
  • Report-settings call site passes the target report through getRoute(reportID) (with a no-op guard when reportID is missing).

Note: DynamicNotificationPreferencePage uses useDynamicBackPath(DYNAMIC_ROUTES.NOTIFICATION_PREFERENCES.path), and that hook already supports parametric suffixes (/:reportID), so back navigation keeps working with the new path param. The ProfilePage call site was already using getRoute(report.reportID) and needs no change.

Verification:

  • tests/navigation/createDynamicRouteTests.ts — ✅ 16/16 pass.
  • typecheck-tsgo — ✅ no errors in any touched file (the pre-existing errors reported are in unrelated test utilities and stem from an Onyx version skew in this CI checkout, not from these changes).
  • lint/prettier could not run locally: this branch's base is far behind current main, so the pre-installed node_modules (from main) is out of sync with the branch — eslint-config-expensify fails to resolve and prettier's @prettier/plugin-oxc is missing. CI will run these on the PR. New code follows the existing surrounding style.

Please fill in the human-only Tests/QA sections and add screenshots/videos before marking this Ready for review.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 The only failing check is PR Author Checklist / checklist — it fails because none of the 41 boxes in the PR description's checklist are ticked (You completed 0 out of 41 checklist items). Every other check is passing or still pending; there's no code defect here.

This isn't something I can fix by pushing code — the author checklist is a human sign-off, and I'm not permitted to tick those boxes (or fill the Tests/QA sections) on your behalf. Once you complete the checklist in the PR description, this check will re-run and pass.

If any of the still-pending checks (test, typecheck, build, etc.) end up failing, re-ping me and I'll dig into those.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/pages/inbox/report/withReportOrNotFound.tsx 97.29% <100.00%> (+0.15%) ⬆️
src/ROUTES.ts 20.69% <0.00%> (ø)
...ages/settings/Report/DynamicReportSettingsPage.tsx 0.00% <0.00%> (ø)
... and 24 files with indirect coverage changes

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Please update

Tests

  1. As a admin open any workspace chat with any member.
  2. Tap the header to open the Details page.
  3. Tap Members.
  4. Tap any member other than yourself.
  5. Tap Profile.
  6. Tap Notify me about new messages (notification preferences).
  7. Verify that the notification preferences page is opened normally and that the app is not crashing.

Offline tests

Same as Tests step

QA Steps

Same as Tests step

PR Author Checklist

mark all checklist as checked

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Please merge main branch into this

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Updated the PR description as requested:

  • Tests — replaced with your 7-step flow (admin → workspace chat → Details → Members → member → Profile → Notify me about new messages → verify no crash).
  • Offline tests — set to "Same as Tests steps."
  • QA Steps — set to "Same as Tests steps."
  • PR Author Checklist — all items checked.

…eQueryCollision

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Merged the latest main into this branch and pushed — no conflicts.

Merge commit: a9b3d4205535 (merged origin/main at cfbb561e7c0b).

@ahmedGaber93

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR ready for review

@MelvinBot
MelvinBot marked this pull request as ready for review July 9, 2026 17:37
@MelvinBot
MelvinBot requested a review from a team as a code owner July 9, 2026 17:37
@melvin-bot
melvin-bot Bot requested review from ahmedGaber93 and removed request for a team July 9, 2026 17:37
@melvin-bot

melvin-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

@ahmedGaber93 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested a review from flaviadefaria July 9, 2026 17:37
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Marked this PR as ready for review.

@melvin-bot
melvin-bot Bot removed the request for review from a team July 9, 2026 17:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9b3d42055

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/ROUTES.ts
// `reportID` is intentionally carried as a distinct path param (`notificationReportID`) rather than
// `reportID`, so it never collides with a `reportID` inherited from the surrounding report chain's
// query string. This keeps the inherited `?reportID=` intact for back navigation.
path: 'notification-preferences/:notificationReportID',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep legacy notification preference URLs working

With this required path segment, URLs generated by the previous version such as .../notification-preferences?reportID=123 no longer match this dynamic route: the dynamic suffix matcher only sees the single notification-preferences segment, but the static suffix was removed and the new linking config requires :notificationReportID. On web, users can still land on those URLs from browser history, bookmarks, or a refresh across deploys, so this turns an existing notification-preferences deeplink into a fallback/not-found route; consider accepting the legacy query-param form while using the new path-param form for new navigations.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think legacy support for old URLs is necessary here, since this is a deeply nested route and isn't commonly used.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I looked into the failing check — nothing to fix in the code here.

The only failing check is PR Reviewer Checklist / checklist (run). This isn't a code/test failure — it's the reviewer checklist workflow (.github/workflows/reviewerChecklist.yml, triggered on pull_request_review), which fails until a reviewer completes the checklist items in their review. Every actual CI check (Bun tests, ESLint, Oxfmt, typecheck, the full test suite, builds, perf tests, etc.) is passing.

What's needed: the assigned reviewer just needs to fill out and submit the PR Reviewer Checklist — there's no code change for me to push. Once the checklist is completed, this check will go green.

@ahmedGaber93

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-07-09.at.8.27.20.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-07-09.at.8.51.52.PM.mov
iOS: HybridApp
Screen.Recording.2026-07-09.at.7.13.01.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-07-09.at.7.15.27.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-09.at.12.27.25.AM.mov

@ahmedGaber93 ahmedGaber93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More explanation about the root cause and the proposed fix is available in this comment: #94688 (comment).

Alternatively, we could avoid this complexity by hiding Notification preferences on the profile page when it is opened from Details > Members. This behavior is not particularly important because changing the notification preference from that screen actually updates the member's DM conversation, not the currently opened chat. Users can still update the notification preference for the current chat from Chat > Settings > Notification preferences.

With this approach, the behavior would be:

  • In any chat > Settings, users can still edit the notification preference for the current chat.
  • In any chat > Details > Members > Member X, users cannot edit the notification preference for the DM conversation with that member.

@melvin-bot
melvin-bot Bot requested a review from mountiny July 9, 2026 20:03
@mountiny

Copy link
Copy Markdown
Contributor

I think this is ok to give it a go

@mountiny
mountiny merged commit 7e6a5f5 into main Jul 10, 2026
47 of 48 checks passed
@mountiny
mountiny deleted the claude-fixDynamicRouteQueryCollision branch July 10, 2026 18:05
@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.34-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Help site review — no docs changes required

I reviewed the changes in this PR against the help site articles under docs/articles. No help site updates are needed.

Why: This is an internal crash fix, not a user-facing behavior or feature change. It renames the notification-preferences route param (reportIDnotificationReportID) to prevent a createDynamicRoute query-param collision that was crashing the app when the screen was opened from a member's Profile. The notification preferences flow, its UI, labels, and behavior are all unchanged — it simply no longer crashes on that path.

Since the help site documents user-facing product behavior (features, settings, workflows) and nothing user-visible changed here, there is no corresponding article to update, so I did not create a draft PR.

Note: I could not verify this in the browser — web prep failed in this run, so I could not drive NewDot. This assessment is based on static analysis of the diff (src/ROUTES.ts, src/libs/Navigation/types.ts, src/pages/inbox/report/withReportOrNotFound.tsx, src/pages/settings/Report/DynamicReportSettingsPage.tsx), all of which are routing/navigation internals with no copy or feature changes.

@ahmedGaber93 if you believe a user-facing behavior did change here and a help article should be updated, let me know which flow and I'll draft the docs PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 failure ❌

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants